package lesson01;

import java.io.*;
import java.util.Scanner;

public class Demo0109 {
    public static void main(String[] args) throws IOException {
        File file=new File("./TestRead.txt");
        FileInputStream fileInputStream=new FileInputStream(file);
        //借助scnner一次读取一行
        Scanner scanner=new Scanner(fileInputStream,"Utf-8");
        while (true){
            if(!scanner.hasNextLine()){
                break;
            }
            String s=scanner.nextLine();
            System.out.println(s);
        }
        scanner.close();
        fileInputStream.close();
    }
}
